<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目技术实现详解</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            overflow-x: auto;
        }
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            bottom: -10px;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 2px;
        }
        .tech-tag {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.875rem;
            display: inline-block;
            margin: 4px;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6">
            <div class="max-w-4xl mx-auto text-center">
                <h1 class="text-5xl font-bold mb-6 leading-tight">项目技术实现详解</h1>
                <p class="text-xl opacity-90 leading-relaxed">深入剖析大规模电商平台的架构设计与核心技术实现</p>
                <div class="mt-8 flex justify-center space-x-4">
                    <span class="tech-tag"><i class="fas fa-code mr-2"></i>Spring Boot</span>
                    <span class="tech-tag"><i class="fas fa-database mr-2"></i>MySQL</span>
                    <span class="tech-tag"><i class="fas fa-server mr-2"></i>Redis</span>
                    <span class="tech-tag"><i class="fas fa-cubes mr-2"></i>Kubernetes</span>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container mx-auto px-6 py-12">
        <!-- Project Overview -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-8 card-hover">
            <h2 class="text-3xl font-bold mb-6 relative section-title">项目背景概述</h2>
            <div class="grid md:grid-cols-2 gap-8 mt-8">
                <div>
                    <h3 class="text-xl font-semibold mb-4 text-purple-700"><i class="fas fa-project-diagram mr-2"></i>项目简介</h3>
                    <p class="text-gray-700 leading-relaxed">
                        <span class="drop-cap">我</span>参与了一个大规模电商平台的开发，该平台需要处理高并发的用户请求，并且要求系统具有高可用性和可扩展性。项目采用微服务架构，支持日均千万级访问量，峰值QPS达到10万+。
                    </p>
                </div>
                <div>
                    <h3 class="text-xl font-semibold mb-4 text-purple-700"><i class="fas fa-layer-group mr-2"></i>技术栈</h3>
                    <div class="space-y-2">
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-green-500 mr-2"></i>
                            <span class="text-gray-700">Spring Boot 微服务框架</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-green-500 mr-2"></i>
                            <span class="text-gray-700">MySQL 主从架构数据库</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-green-500 mr-2"></i>
                            <span class="text-gray-700">Redis 分布式缓存系统</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-green-500 mr-2"></i>
                            <span class="text-gray-700">Docker + Kubernetes 容器化编排</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Architecture Diagram -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-8">
            <h3 class="text-2xl font-bold mb-6 text-center">系统架构图</h3>
            <div class="mermaid">
                graph TB
                    A[用户端] -->|HTTPS| B[Nginx负载均衡]
                    B --> C[API网关]
                    C --> D[认证服务]
                    C --> E[商品服务]
                    C --> F[订单服务]
                    D --> G[(MySQL主库)]
                    E --> H[(MySQL从库)]
                    F --> I[Redis缓存]
                    F --> J[Kafka消息队列]
                    J --> K[支付服务]
                    K --> L[第三方支付]
                    style A fill:#f9f,stroke:#333,stroke-width:2px
                    style B fill:#bbf,stroke:#333,stroke-width:2px
                    style I fill:#f96,stroke:#333,stroke-width:2px
            </div>
        </div>

        <!-- Core Modules -->
        <div class="space-y-8">
            <!-- Authentication Module -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <h2 class="text-3xl font-bold mb-6 relative section-title">核心功能模块实现</h2>
                
                <div class="mt-8">
                    <h3 class="text-2xl font-semibold mb-4 text-purple-700"><i class="fas fa-shield-alt mr-2"></i>用户认证与授权</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <h4 class="font-semibold mb-2">功能特性</h4>
                            <ul class="space-y-2 text-gray-700">
                                <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>JWT无状态会话管理</li>
                                <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>BCrypt密码加密存储</li>
                                <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>基于角色的权限控制(RBAC)</li>
                                <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>OAuth2.0第三方登录集成</li>
                            </ul>
                        </div>
                        <div>
                            <h4 class="font-semibold mb-2">技术实现</h4>
                            <div class="code-block p-4 text-sm">
                                <pre><code>@EnableWebSecurity
public class SecurityConfig {
    @Override
    protected void configure(HttpSecurity http) {
        http.csrf().disable()
            .authorizeRequests()
            .antMatchers("/public/**").permitAll()
            .anyRequest().authenticated();
    }
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Product Management -->
                <div class="mt-12 pt-8 border-t border-gray-200">
                    <h3 class="text-2xl font-semibold mb-4 text-purple-700"><i class="fas fa-box mr-2"></i>商品管理</h3>
                    <div class="bg-purple-50 rounded-lg p-6 mb-6">
                        <p class="text-gray-700 mb-4">实现了高性能的商品管理系统，支持千万级商品数据的快速检索和管理。</p>
                        <div class="grid md:grid-cols-3 gap-4">
                            <div class="bg-white rounded-lg p-4 text-center">
                                <i class="fas fa-search text-3xl text-purple-600 mb-2"></i>
                                <h5 class="font-semibold">Elasticsearch搜索</h5>
                                <p class="text-sm text-gray-600">毫秒级全文检索</p>
                            </div>
                            <div class="bg-white rounded-lg p-4 text-center">
                                <i class="fas fa-file-alt text-3xl text-purple-600 mb-2"></i>
                                <h5 class="font-semibold">分页优化</h5>
                                <p class="text-sm text-gray-600">深度分页性能优化</p>
                            </div>
                            <div class="bg-white rounded-lg p-4 text-center">
                                <i class="fas fa-sync text-3xl text-purple-600 mb-2"></i>
                                <h5 class="font-semibold">缓存策略</h5>
                                <p class="text-sm text-gray-600">多级缓存架构</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Order Processing -->
                <div class="mt-12 pt-8 border-t border-gray-200">
                    <h3 class="text-2xl font-semibold mb-4 text-purple-700"><i class="fas fa-shopping-cart mr-2"></i>订单处理</h3>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <i class="fas fa-lock text-purple-600 mt-1 mr-3"></i>
                            <div>
                                <h5 class="font-semibold">分布式事务管理</h5>
                                <p class="text-gray-600">使用Seata实现分布式事务，确保订单创建和库存扣减的一致性</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-stream text-purple-600 mt-1 mr-3"></i>
                            <div>
                                <h5 class="font-semibold">消息队列异步处理</h5>
                                <p class="text-gray-600">Kafka处理订单流转，峰值处理能力达10万订单/秒</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-key text-purple-600 mt-1 mr-3"></i>
                            <div>
                                <h5 class="font-semibold">分布式锁</h5>
                                <p class="text-gray-600">Redis分布式锁防止订单重复提交和超卖</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Performance Optimization -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <h2 class="text-3xl font-bold mb-6 relative section-title">性能优化与调优</h2>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-4"><i class="fas fa-database mr-2 text-blue-600"></i>数据库优化</h3>
                        <div class="bg-blue-50 rounded-lg p-4">
                            <ul class="space-y-2 text-gray-700">
                                <li><i class="fas fa-check text-green-500 mr-2"></i>建立复合索引优化查询</li>
                                <li><i class="fas fa-check text-green-500 mr-2"></i>读写分离架构设计</li>
                                <li><i class="fas fa-check text-green-500 mr-2"></i>慢查询分析与优化</li>
                                <li><i class="fas fa-check text-green-500 mr-2"></i>分库分表策略实施</li>
                            </ul>
                        </div>
                    </div>
                    <div>
                        <h3 class="text-xl font-semibold mb-4"><i class="fas fa-tachometer-alt mr-2 text-orange-600"></i>缓存策略</h3>
                        <div class="bg-orange-50 rounded-lg p-4">
                            <ul class="space-y-2 text-gray-700">
                                <li><i class="fas fa-check text-green-500 mr-2"></i>多级缓存架构设计</li>
                                <li><i class="fas fa-check text-